<?php /* @var $this Controller */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div id="page">

	<div id="header">
		<div class="top clearfix">
			<div id="logo"><strong><?php echo CHtml::encode(Yii::app()->name); ?></strong></div>
            <div class="topr">
			<?php $this->widget('zii.widgets.CMenu',array(
				'items'=>array(
					array('label'=>Yii::t('tender','Welcome you').' '.Yii::app()->user->name, 'itemOptions'=>array('class'=>'nobg')),
					array('label'=>Yii::t('tender','Login'), 'url'=>Yii::app()->getModule('user')->loginUrl, 'visible'=>Yii::app()->user->isGuest),
					array('label'=>Yii::t('tender','Logout'), 'url'=>Yii::app()->getModule('user')->logoutUrl, 'visible'=>!Yii::app()->user->isGuest),
				),
			)); ?>
        	</div>
        </div>
	

	<div id="mainmenu">
	<div id="tDiv" class="fr"></div>
		<?php $this->widget('application.extensions.mbmenu.MbMenu',array(
			'items'=>array(
				array('label'=>Yii::t('tender','Home'), 'url'=>array('/')),
				array('label'=>Yii::t('tender','Basedata'), 'url' => array('/user'), 'items'=>array(
					array('label'=>Yii::t('tender','User management'),'url'=>array('/user')),
					array('label'=>Yii::t('tender','Rights management'),'url'=>array('/rights/assignment/')),
					array('label'=>Yii::t('tender','Projects management'),'url'=>array('/project')),
					array('label'=>Yii::t('tender','Tenderer management'),'url'=>array('/tenderer')),
					),
					'visible' => Yii::app()->User->checkAccess('Task_System'),
				),
				array('label'=>Yii::t('tender','Tender management'), 'url'=>array('/tender')),
				array('label'=>Yii::t('tender','Contact'), 'url'=>array('/site/contact')),
			),
		)); ?>
	</div><!-- mainmenu -->
	</div><!-- header -->
	<div id="bread" class="clearfix">
		<div class="fr"><a href="javascript:window.history.back()"><?php echo Yii::t('tender','Return back')?></a></div>
		<?php $this->widget('zii.widgets.CBreadcrumbs', array(
			'links'=>$this->breadcrumbs,
		)); ?>
	</div><!-- breadcrumbs -->

	<?php echo $content; ?>

	<div id="footer">
		Copyright &copy; <?php echo date('Y'); ?> by TianYin Company.<br/>
		All Rights Reserved.<br/>
		<?php echo Yii::powered(); ?>
	</div><!-- footer -->

</div><!-- page -->
<?php
//$dat = date('Y-m-j G:i:s');
Yii::app()->clientScript->registerScript("showBread","
if($('#sidebar ul').length>0){
	//$('#bread').show();
}else{
	$('#sidebar').parent().remove();
	if($('#content').length>0){
		$('#content').css('margin','0 10px');
		$('#bread').css('margin','0 10px');
	}else{
		$('#bread').remove();
	}
}
");
?>

<script type="text/javascript">
if($('#sidebar').length>0){
	//$("#bread").show();
}else{
	$('#bread').remove();
}
</script>
</body>
</html>
